﻿using System;
using System.Collections.Generic;
using Microsoft.Forums.OfflineStore;

namespace Microsoft.Forums.SyncService
{
    public interface IForumServiceProvider
    {
        /// <summary>
        /// The name of this sync provider
        /// </summary>
        string ProviderName { get; }

        /// <summary>
        /// The unique provider Id for this sync service
        /// </summary>
        Guid ProviderId { get; }

        /// <summary>
        /// The Uri that this service provider is connected to
        /// </summary>
        Uri Uri{ get; }

        /// <summary>
        /// Pings the web service
        /// </summary>
        /// <returns> Logged in users id if succesfull</returns>
        string Ping();

        /// <summary>
        /// Gets a list of all the forums 
        /// </summary>
        /// <param name="brand"></param>
        /// <param name="locale"></param>
        /// <returns>List of Forums for the given brand and locale</returns>
        IList<Forum> GetAvailableForums(string brand, int locale);

        /// <summary>
        /// Get a collection of all the supported brands
        /// </summary>
        /// <returns>collection of brands</returns>
        IList<String> SupportedBrands { get; }

        /// <summary>
        /// Get a collection of all the supported locales
        /// </summary>
        /// <returns>collection of locales</returns>
        IList<KeyValuePair<int, string>> SupportedLocales{ get; }

        /// <summary>
        /// Get a collection of forum objects which have been deleted
        /// </summary>
        /// <param name="fromDate">Deletions after this date</param>
        /// <param name="toDate">Deletions before this date</param>
        /// <returns>The collection</returns>
        IList<Forum> GetDeletedForums(DateTime fromDate, DateTime toDate);

        /// <summary>
        /// Get the forum object given a forum id
        /// </summary>
        /// <param name="forumID">The id of the forum</param>
        /// <returns>A forum object</returns>
        Forum GetForum(Guid forumId);

        /// <summary>
        /// Gets every thread of a forum
        /// </summary>
        /// <param name="forumID">The parent forum</param>
        /// <returns>The collection of threads</returns>
        IList<Thread> GetAllThreads(Guid forumId);

        /// <summary>
        /// Get all the threads of a forum which have been update between the fromData and toDate
        /// </summary>
        /// <param name="forumID">ID of the parent forum</param>
        /// <param name="fromDate">Updated after this date</param>
        /// <param name="toDate">Updated before this date</param>
        /// <returns>Collection of updated threads</returns>
        IList<Thread> GetUpdatedThreads(Guid forumId, DateTime fromDate, DateTime toDate);

        /// <summary>
        /// Get a collection of thread objects which have been deleted
        /// </summary>
        /// <param name="forumID">ID of the parent forum</param>
        /// <param name="fromDate">Deletions after this date</param>
        /// <param name="toDate">Deletions before this date</param>
        /// <returns>The collection</returns>
        IList<Thread> GetDeletedThreads(Guid forumId, DateTime fromDate, DateTime toDate);

        /// <summary>
        /// Get the thread object given a forum id
        /// </summary>
        /// <param name="threadID">The id of the thread</param>
        /// <returns>A thread object</returns>
        Thread GetThread(Guid threadId);

        /// <summary>
        /// Gets every post of a thread
        /// </summary>
        /// <param name="threadID">The parent thread</param>
        /// <returns>The collection of posts</returns>
        IList<Post> GetAllPosts(Guid threadId);

        /// <summary>
        /// Get all the posts of a forum which have been update between the fromData and toDate
        /// </summary>
        /// <param name="threadID">ID of the parent thread</param>
        /// <param name="fromDate">Updated after this date</param>
        /// <param name="toDate">Updated before this date</param>
        /// <returns>Collection of updated posts</returns>
        IList<Post> GetUpdatedPosts(Guid threadId, DateTime fromDate, DateTime toDate);

        /// <summary>
        /// Get a collection of post objects which have been deleted
        /// </summary>
        /// <param name="threadID">ID of the parent thread</param>
        /// <param name="fromDate">Deletions after this date</param>
        /// <param name="toDate">Deletions before this date</param>
        /// <returns>The collection</returns>
        IList<Post> GetDeletedPosts(Guid threadId, DateTime fromDate, DateTime toDate);

        /// <summary>
        /// Get the post object given a forum id
        /// </summary>
        /// <param name="forumID">The id of the post</param>
        /// <returns>A post object</returns>
        Post GetPost(Guid postId);




    }
}
